package edu.nf.takeoutdemo.model.converter;

import edu.nf.takeoutdemo.model.dto.SetmealDTO;
import edu.nf.takeoutdemo.model.entity.Setmeal;
import edu.nf.takeoutdemo.model.vo.SetmealVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 *
 * @author zjl
 * @date 2025/10/28
 */
@Mapper(componentModel = "spring")
public interface SetmealConverter {

    @Mappings({
            @Mapping(source = "id",target = "id"),
            @Mapping(source = "categoryId",target = "categoryId"),
            @Mapping(source = "name",target = "name"),
            @Mapping(source = "price",target = "price"),
            @Mapping(source = "status",target = "status"),
            @Mapping(source = "description",target = "description"),
            @Mapping(source = "image",target = "image")
    })
    Setmeal toSetmeal(SetmealDTO setmealDTO);

    @Mappings({
            @Mapping(source = "id",target = "id"),
            @Mapping(source = "categoryId",target = "categoryId"),
            @Mapping(source = "price",target = "price"),
            @Mapping(source = "name",target = "name"),
            @Mapping(source = "status",target = "status"),
            @Mapping(source = "description",target = "description"),
            @Mapping(source = "image",target = "image"),
            @Mapping(source = "updateTime",target = "updateTime"),
    })
    SetmealVO toSetmealVO(Setmeal setmeal);
}
